package com.jusu.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class IsTrue extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		HttpSession session = request.getSession();
		response.setContentType("text/html;charset=UTF-8");
		PrintWriter out = response.getWriter();
		String verCode = (String) session.getAttribute("vCode");
		String userCode = request.getParameter("code");
//		System.out.println(verCode + "---" + userCode);
		//System.out.println(verCode.equals(userCode));
		if(verCode.equals(userCode)){
			//System.out.println("success");
			out.print("true");
			
		}else {
			//System.out.println("error");
			out.print("false");
		}
		
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
